
/**
 * Created by xiongshilin on 2017/4/13.
 */
(function(){
    ADF.figure.BootstrapContainerFigure = function() {
        ADF.figure.BootstrapContainerFigure.superclass.constructor.call(this);
        this.setLayoutManager(new COM.draw2d.XYLayout());
    };

    COM.util.defineClass(ADF.figure.BootstrapContainerFigure, AGEF.CompositeFigure, {
        paintChildren: function(graphics){
            ADF.figure.BootstrapContainerFigure.superclass.paintChildren.call(this, graphics);
        },
        initEventListener: function() {
            this.addMouseMotionListener({mouseEntered: function(event, source) {
                var widget = this.getWidget();
                COM.util.HTMLUtil.setStyle(widget.getDomElement(), {"background-color":"rgba(245,245,245,0.5)"});//#f8f8f8
            }.bind(this),mouseExited: function(event, source) {
                var widget = this.getWidget();
                COM.util.HTMLUtil.setStyle(widget.getDomElement(), {"background":"none"});
            }.bind(this)
            });
        },
        add: function(child, constraint, index){
            var newConstraint = this.addChildWidget(child, constraint, index);
            if(newConstraint) {
                constraint = newConstraint;
                constraint.setSize(-1, -1);
            }
            AGEF.CompositeFigure.superclass.add.call(this, child, constraint, index);
        },
        useLocalCoordinates: function() {
            return true;
        }
    });
})();